﻿/* Copyright 2008 dnAnalytics Project.
 *
 * Contributors to this file:
 * Patrick van der Velde
 * Marcus Cuda - http://marcus.cuda.net
 * Jurgen Van Gael - http://mlg.eng.cam.ac.uk/jurgen/
 *
 * This file is part of dnAnalytics.  dnAnalytics is licensed under the 
 * Microsoft Public License. See License.txt for a complete copy of the
 * license.
 */
using System;
using dnAnalytics;
using dnAnalytics.Properties;

namespace dnAnalytics
{
    /// <summary>
    /// Sets parameters for the library.
    /// </summary>
    public static class Control
    {
        /// <summary>Suggests to the runtime the maximum number of threads to use.</summary>
        /// <param name="numThreads">Number of threads suggested.</param>
        /// <exception cref="ArgumentException">If the number of threads is a nonpositive integer.</exception>
        public static void SetNumberThreads(int numThreads)
        {
            if (numThreads < 1)
            {
                throw new ArgumentException("numThreads", Resources.NotPositive);
            }

            SafeNativeMethods.SetNumberThreads(numThreads);
        }
    }
}
